Skip to content

Enable initial r support#2721

Merged
AndreasArvidsson merged 28 commits intocursorless-dev:mainfrom
BlueDrink9:main
May 25, 2025
Merged

Enable initial r support#2721
AndreasArvidsson merged 28 commits intocursorless-dev:mainfrom
BlueDrink9:main

Conversation

@BlueDrink9
Copy link
Copy Markdown
Contributor

@BlueDrink9 BlueDrink9 commented Jan 12, 2025

I'm still wrapping my head around treesitter to add the supported scopes, so I'll update this PR and add relevant tests once I do + once the r PR is added to vscode's parse tree

Checklist

@BlueDrink9 BlueDrink9 requested a review from a team as a code owner January 12, 2025 03:42
@AndreasArvidsson AndreasArvidsson marked this pull request as draft January 12, 2025 07:54
@BlueDrink9 BlueDrink9 marked this pull request as ready for review May 13, 2025 21:34
@BlueDrink9
Copy link
Copy Markdown
Contributor Author

I'm marking this as ready to make adding scopes easier. Once r support is included in cursorless, it will be easier for it to pick it up as an option for adding scopes

@AndreasArvidsson
Copy link
Copy Markdown
Member

Latest version of the parse tree is published and should be available in the marketplace very soon.

Comment thread data/fixtures/scopes/r/functionName.scope
@BlueDrink9
Copy link
Copy Markdown
Contributor Author

@AndreasArvidsson ready to review! Thank you again for your help yesterday

@AndreasArvidsson
Copy link
Copy Markdown
Member

Please add a scope test for an empty argument list as well. The difference is the insertion delimiter. Please have a look at how it's implemented in other languages.

@AndreasArvidsson
Copy link
Copy Markdown
Member

I would recommend that you create multiple scope files for the same facet instead of adding multiple different code examples in the same file. It's much simpler to review it that way.

Comment thread data/fixtures/scopes/r/functionName.scope
Comment thread data/fixtures/scopes/r/name.assignment.scope Outdated
Comment thread data/fixtures/scopes/r/name.assignment.scope Outdated
Comment thread data/fixtures/scopes/r/name.variable.scope
Comment thread data/fixtures/scopes/r/name.variable.scope Outdated
Comment thread data/fixtures/scopes/r/value.assignment.scope Outdated
Comment thread data/fixtures/scopes/r/value.variable.scope Outdated
Comment thread data/fixtures/scopes/r/value.variable.scope Outdated
Comment thread packages/common/src/scopeSupportFacets/r.ts
Comment thread packages/common/src/scopeSupportFacets/r.ts Outdated
@BlueDrink9 BlueDrink9 force-pushed the main branch 2 times, most recently from 8bb8dee to 3bf717c Compare May 17, 2025 03:27
Comment thread queries/r.scm Outdated
Comment thread data/fixtures/scopes/r/argument.actual.scope
Comment thread packages/cursorless-vscode/src/scripts/initLaunchSandbox.ts Outdated
Comment thread packages/cursorless-org-docs/src/docs/contributing/adding-a-new-language.md Outdated
Comment thread data/fixtures/scopes/r/ifStatement3.scope Outdated
Comment thread packages/common/src/scopeSupportFacets/r.ts
Comment thread packages/common/src/scopeSupportFacets/r.ts
Comment thread packages/common/src/scopeSupportFacets/r.ts Outdated
@AndreasArvidsson
Copy link
Copy Markdown
Member

Looks like you're starting to get the hang of this :)

  • Might be worth adding a test for a vertical argument list for both argument.actual and argumentList.formal.
  • Looks like you're still missing argument.formal
  • Don't forget to add iteration scopes for argument otherwise you can't do every arg

BlueDrink9 and others added 3 commits May 24, 2025 09:38
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
Comment thread data/fixtures/scopes/r/argument.actual.iteration.scope
Comment thread data/fixtures/scopes/r/argument.formal.iteration.scope Outdated
Comment thread data/fixtures/scopes/r/argument.formal.iteration.scope
Comment thread packages/cursorless-org-docs/src/docs/user/languages/r.mdx Outdated
@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue May 25, 2025
Merged via the queue into cursorless-dev:main with commit 074be3a May 25, 2025
15 checks passed
@AndreasArvidsson
Copy link
Copy Markdown
Member

@BlueDrink9 Regarding iteration domain for arguments
#2930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants